package com.moleq.models;

import com.moleq.db.DatabaseSchema;

import android.R.integer;

public class Users {
//	CREATE TABLE t_user_setting
//	(us_id integer NOT NULL,
//	us_login_id varchar(20) NOT NULL,
//	us_pwd varchar(20) NOT NULL,
//	us_info varchar(30) NULL,
//	us_active varchar(1) NOT NULL,
//	PRIMARY KEY (us_id));
	
	private int us_id;
	private String us_login_id;
	private String us_pwd;
	private String us_info;
	private String us_active;
	private String us_confirm_pwd;
	private int us_color;
	private String us_manager;
	
	public String getUs_manager() {
		return us_manager;
	}

	public void setUs_manager(String us_manager) {
		this.us_manager = us_manager;
	}

	public int getUs_color() {
		return us_color;
	}

	public void setUs_color(int us_color) {
		this.us_color = us_color;
	}

	public String getUs_confirm_pwd() {
		return us_confirm_pwd;
	}

	public void setUs_confirm_pwd(String us_confirm_pwd) {
		this.us_confirm_pwd = us_confirm_pwd;
	}

	public Users(){}
	
	public Users(int us_id,String us_login_id,String us_pwd,String us_info,String us_active,int us_color,String us_manager){
		this.us_id = us_id;
		this.us_login_id = us_login_id;
		this.us_pwd = us_pwd;
		this.us_info = us_info;
		this.us_active = us_active;
		this.us_color = us_color;
		this.us_manager = us_manager;
	}

	public int getUs_id() {
		return us_id;
	}

	public void setUs_id(int us_id) {
		this.us_id = us_id;
	}

	public String getUs_login_id() {
		return us_login_id;
	}

	public void setUs_login_id(String us_login_id) {
		this.us_login_id = us_login_id;
	}

	public String getUs_pwd() {
		return us_pwd;
	}

	public void setUs_pwd(String us_pwd) {
		this.us_pwd = us_pwd;
	}

	public String getUs_info() {
		return us_info;
	}

	public void setUs_info(String us_info) {
		this.us_info = us_info;
	}

	public String getUs_active() {
		return us_active;
	}

	public void setUs_active(String us_active) {
		this.us_active = us_active;
	}
	
	public String toMGData(String Action) {
		String Result = Action + "|" + DatabaseSchema.UserSetting.SCHEMA_NAME
				+ "|(" + getUs_id() + "," + CheckNull(getUs_login_id()) + "," + CheckNull(getUs_pwd())+
				"," + CheckNull(getUs_info()) +"," + CheckNull(getUs_active())+"," + getUs_color()+","+CheckNull(getUs_manager())+")";
		return Result;
	}
	
	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}

}
